<template>
  <div class="help-article-container">
    <!-- 顶部导航栏 -->
    <div class="article-header">
      <div class="header-left">
        <el-button type="text" @click="goBack">
          <i class="el-icon-arrow-left"></i> 返回
        </el-button>
      </div>
      <div class="header-title">{{ article.title }}</div>
      <div class="header-right"></div>
    </div>

    <!-- 文章内容 -->
    <div class="article-content">
      <div class="content-wrapper">
        <h1 class="main-article-title">{{ article.title }}</h1>
        <div v-for="(section, index) in article.sections" :key="index" class="content-section">
          <h2 v-if="section.title" class="section-title">{{ section.title }}</h2>
          <p v-if="section.text" class="section-text">{{ section.text }}</p>
          <div v-if="section.image" class="section-image-wrapper">
            <img :src="section.image" :alt="section.imageAlt" class="section-image">
            <div class="image-caption">{{ section.imageAlt }}</div>
          </div>
          <div v-if="index < article.sections.length - 1" class="section-divider"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HelpArticleView',
  data() {
    return {
      article: {
        id: 1,
        title: '如何新建和保存乐谱？',
        sections: [
          {
            title: '创建新乐谱',
            text: '点击首页的"新建谱子"按钮，即可开始创建一份新的乐谱。系统会自动为您创建一个空白乐谱，并进入编辑界面。',
            image: 'https://via.placeholder.com/800x400?text=新建乐谱示例',
            imageAlt: '新建乐谱界面示例'
          },
          {
            title: '编辑乐谱',
            text: '在编辑界面中，您可以使用工具栏上的各种功能来编辑乐谱。左侧工具栏提供了音符、休止符等基本元素，右侧工具栏则提供了更多高级功能。',
            image: 'https://via.placeholder.com/800x400?text=编辑界面示例',
            imageAlt: '编辑界面示例'
          },
          {
            title: '保存乐谱',
            text: '编辑完成后，点击右上角的保存按钮即可保存您的乐谱。系统支持多种格式的导出，包括PDF、图片等格式。您也可以选择将乐谱保存到云端，方便随时访问和编辑。',
            image: 'https://via.placeholder.com/800x400?text=保存界面示例',
            imageAlt: '保存界面示例'
          }
        ]
      }
    }
  },
  methods: {
    goBack() {
      this.$router.push('/')
    }
  }
}
</script>

<style scoped>
.help-article-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f7f8fa 0%, #eef2f7 100%);
}

.article-header {
  height: 64px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.header-left {
  margin-right: 24px;
}

.header-left .el-button {
  font-size: 14px;
  padding: 0 12px;
}

.header-left .el-icon-arrow-left {
  margin-right: 4px;
  font-size: 16px;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  text-align: left;
}

.article-content {
  padding: 84px 40px 40px;
  max-width: 820px;
  margin: 0 auto;
}

.content-wrapper {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(64,158,255,0.07), 0 1.5px 6px rgba(0,0,0,0.04);
  padding: 48px 40px 40px 40px;
  margin-top: 8px;
}

.main-article-title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #222;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.content-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  text-align: left;
}

.section-text {
  font-size: 12px;
  color: #444;
  line-height: 2;
  margin-bottom: 18px;
  text-indent: 2em;
  letter-spacing: 0.1px;
  text-align: left;
}

.section-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.section-image {
  width: 100%;
  max-width: 700px;
  border-radius: 10px;
  border: 1.5px solid #e3eaf2;
  box-shadow: 0 2px 12px rgba(64,158,255,0.08), 0 1.5px 6px rgba(0,0,0,0.04);
  margin-bottom: 8px;
  background: #f8fafc;
}

.image-caption {
  font-size: 12px;
  color: #888;
  text-align: left;
  margin-bottom: 0;
}

.section-divider {
  border-bottom: 1.5px dashed #e3eaf2;
  margin: 36px 0 0 0;
}

.content-section:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .article-header {
    padding: 0 10px;
  }
  .article-content {
    padding: 84px 4px 20px 4px;
  }
  .content-wrapper {
    padding: 18px 6px 18px 6px;
  }
  .main-article-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .section-title {
    font-size: 12px;
    margin-bottom: 8px;
  }
  .section-text {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .section-image {
    max-width: 100%;
  }
}
</style> 